create table Room
(
	 [RoomId] int identity(1, 1) primary key
	,[HotelId] int
	,[RoomTypeId] int
	,[Utilities] varchar(64)
	,[RoomName] nvarchar(128)
	,[SortDescription] nvarchar(512)
	,[DetailDescription] nvarchar(max)
	,[RoomQuantity] int
	,[PersonQuantity] int
	,[Acreage] int
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

ALTER PROCEDURE RoomGet
	@RoomId int
AS
SELECT *
FROM [Room]
WHERE [Room].[RoomId] = @RoomId
GO

ALTER PROCEDURE RoomList
AS
SELECT *
FROM [Room]
GO

ALTER PROCEDURE RoomInsert
	 @HotelId int
	,@RoomTypeId int
	,@Utilities varchar(64)
	,@RoomName nvarchar(128)
	,@SortDescription nvarchar(512)
	,@DetailDescription nvarchar(max)
	,@RoomQuantity int
	,@PersonQuantity int
	,@Acreage int
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO Room (
	 [HotelId]
	,[RoomTypeId]
	,[Utilities]
	,[RoomName]
	,[SortDescription]
	,[DetailDescription]
	,[RoomQuantity]
	,[PersonQuantity]
	,[Acreage]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @HotelId
	,@RoomTypeId
	,@Utilities
	,@RoomName
	,@SortDescription
	,@DetailDescription
	,@RoomQuantity
	,@PersonQuantity
	,@Acreage
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
)

select SCOPE_IDENTITY()
GO

ALTER PROCEDURE RoomUpdate
	@RoomId int, 
	@HotelId int, 
	@RoomTypeId int, 
	@Utilities varchar(64), 
	@RoomName nvarchar(128), 
	@SortDescription nvarchar(512), 
	@DetailDescription nvarchar(max), 
	@RoomQuantity int, 
	@PersonQuantity int, 
	@Acreage int, 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE Room SET
	    [HotelId] = @HotelId
	   ,[RoomTypeId] = @RoomTypeId
	   ,[Utilities] = @Utilities
	   ,[RoomName] = @RoomName
	   ,[SortDescription] = @SortDescription
	   ,[DetailDescription] = @DetailDescription
	   ,[RoomQuantity] = @RoomQuantity
	   ,[PersonQuantity] = @PersonQuantity
	   ,[Acreage] = @Acreage
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [Room].[RoomId] = @RoomId
GO

ALTER PROCEDURE RoomDelete
	@RoomId int 
AS
DELETE FROM Room
WHERE [Room].[RoomId] = @RoomId
GO